{{! corresponding files: assets_edit.php & assets_edit.json }}


<form accept-charset="UTF-8" class="novalidate" method="post" action="{{#assets_add_action}}{{www_path}}/assets/add/{{/assets_add_action}}">
	<input type="hidden" name="{{form_state_action}}" value="makeitso" />

	<label for="asset_title">{{label_title}}</label>
	<input type="text" id="asset_title" name="asset_title" value="{{title}}" placeholder="Give It A Name" class="required" />
	<label for="asset_description">{{label_description}}</label>
	<textarea rows="3" id="asset_description" name="asset_description">{{description}}</textarea>

	{{#type}}
		<input type="hidden" name="asset_type" value="{{type}}" />
	{{/type}}
	<input type="hidden" name="parent_id" value="{{parent_id}}" />

	{{#metadata_command}}
		<input type="hidden" name="metadata_command" value="{{metadata_command}}" />
		<input type="hidden" name="metadata_name" value="{{metadata_name}}" />
	{{/metadata_command}}

	{{#show_location}}

			<div class="pure-u-1 pure-u-md-1-2">
				<label for="connection_id">{{label_which_connection}}</label>
				<select id="connection_id" name="connection_id">
					{{{connection_options}}}
				</select>
			</div><!--pure-->

			<div class="pure-u-1 pure-u-md-1-2">
				<label for="asset_location">{{label_location}}</label>
				<input type="text" class="required" id="asset_location" name="asset_location" value="{{location}}" />
			</div><!--pure-->

			<div class="pure-u-1">
			<!--
				  *
				  * We should only display the link below if the connection > 0. Check connection ID
				  * on connection_id change, if it's > 0 we request a data_only view of /assets/uploadform
				  * and insert it into the drawer contents
				  *
				  -->
			<div class="drawer noprefix upload-corral">
					<p class="small fadedtext">{{copy_hosting_connection}}<a href="#" data-upload-endpoint="{{{www_path}}}/assets/uploadform/" class="drawerhandle usecolor2 file-upload-trigger"><span class="icon icon-cloud-upload"></span><!--icon--><span>{{copy_upload_a_file}}</span></a></p>
					<div class="drawercontent"></div>
				</div><!--drawer-->
			</div><!--pure-->

			<div class="pure-u-1">
				<button type="submit">{{asset_button_text}}</button>
				</form>
			</div><!--pure-->

	{{/show_location}}
	{{^show_location}}

			<div class="pure-u-1">
				<input type="hidden" name="connection_id" value="" />
				<input type="hidden" name="asset_location" value="" />
				<button type="submit">{{asset_button_text}}</button>
			</div><!--pure-->

		</form>
	{{/show_location}}
